﻿<UserControl x:Class="SL_Drag_Drop.sucDragDropCart"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:dragdrop="clr-namespace:SL_Drag_Drop_BaseClasses;assembly=SL_Drag_Drop_BaseClasses">
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition Height="Auto" ></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>


            <TextBlock Text="You're going on a trip!  What do you take along?" 
                       FontSize="14" Margin="10"
                       HorizontalAlignment="Left" VerticalAlignment="Top"
                       Grid.ColumnSpan="2"></TextBlock>
        
            <TextBlock FontSize="11" TextWrapping="Wrap" Margin="10"
                       HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1"
                       Grid.ColumnSpan="2">
                <Run Text="This example demonstrates more features of the Drag and Drop Manager."></Run>
                <LineBreak></LineBreak>
                <LineBreak></LineBreak>
                <Run Text="The luggage items you can drag to your luggage are DragSources in DropTargets.  Each of these DragSources has AllDropTargetsValid set to True (so the luggage DropTarget doesn't have to be added in code), ShowReturnToOriginalPositionAnimation set to False, DropMode set to ReturnToDragSource, and DragHandleMode set to FullDragSource.  The surrounding DropTargets have ShowHover set to False."></Run>
                <LineBreak></LineBreak>
                <LineBreak></LineBreak>
                <Run Text="The luggage is a DropTarget with a DragSource of which DraggingEnabled is set to False. The DragSourceDropped event of the luggage's DropTarget is handled to show the text you see when you drop a luggage item. "></Run>
            </TextBlock>

        
        <Grid Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Stretch">
            <Grid.RowDefinitions>
                <RowDefinition Height="80"></RowDefinition>
                <RowDefinition Height="80"></RowDefinition>
                <RowDefinition Height="80"></RowDefinition>
            </Grid.RowDefinitions>

            <dragdrop:DropTarget ShowHover="False">
                <dragdrop:DropTarget.Content>
                    <dragdrop:DragSource AllDropTargetsValid="True"
                                         ShowReturnToOriginalPositionAnimation="False"
                                         DropMode="ReturnDragSource" DragHandleMode="FullDragSource"
                                         Tag="Camera">

                        <Image Source="Images/camera.png" HorizontalAlignment="Center"
                           VerticalAlignment="Center" Width="64" Height="64">
                        </Image>

                    </dragdrop:DragSource>
                </dragdrop:DropTarget.Content>
                <dragdrop:DropTarget.Ghost>
                    <Image Source="Images/camera.png" HorizontalAlignment="Center"
                           VerticalAlignment="Center" Width="64" Height="64" Opacity="0.3">
                    </Image>
                </dragdrop:DropTarget.Ghost>
            </dragdrop:DropTarget>

            <dragdrop:DropTarget Grid.Row="1" ShowHover="False">
                <dragdrop:DropTarget.Content>
                    <dragdrop:DragSource AllDropTargetsValid="True"
                                         ShowReturnToOriginalPositionAnimation="False"
                                         DropMode="ReturnDragSource" DragHandleMode="FullDragSource"
                                         Tag="Coffee">

                        <Image Source="Images/coffee.png" HorizontalAlignment="Center"
                           VerticalAlignment="Center" Width="64" Height="64">
                        </Image>

                    </dragdrop:DragSource>
                </dragdrop:DropTarget.Content>
                <dragdrop:DropTarget.Ghost>
                    <Image Source="Images/coffee.png" HorizontalAlignment="Center"
                           VerticalAlignment="Center" Width="64" Height="64" Opacity="0.3">
                    </Image>
                </dragdrop:DropTarget.Ghost>
            </dragdrop:DropTarget>

            <dragdrop:DropTarget Grid.Row="2" ShowHover="False">
                <dragdrop:DropTarget.Content>
                    <dragdrop:DragSource AllDropTargetsValid="True"
                                         ShowReturnToOriginalPositionAnimation="False"
                                         DropMode="ReturnDragSource" DragHandleMode="FullDragSource"
                                         Tag="News" >

                        <Image Source="Images/news.png" HorizontalAlignment="Center"
                           VerticalAlignment="Center" Width="64" Height="64">
                        </Image>

                    </dragdrop:DragSource>
                </dragdrop:DropTarget.Content>
                <dragdrop:DropTarget.Ghost>
                    <Image Source="Images/news.png" HorizontalAlignment="Center"
                           VerticalAlignment="Center" Width="64" Height="64" Opacity="0.3" >
                    </Image>
                </dragdrop:DropTarget.Ghost>
            </dragdrop:DropTarget>


        </Grid>
        
        
        
        <Grid VerticalAlignment="Stretch" HorizontalAlignment="Center" Grid.Row="2" Grid.Column="1" 
              >
            <Grid.RowDefinitions>
                <RowDefinition Height="40"></RowDefinition>
                <RowDefinition Height="200"></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            
          
                
            <dragdrop:DropTarget Width="160" Height="160" HorizontalAlignment="Center"
                                 DragSourceDropped="DropTarget_DragSourceDropped" 
                                 Grid.Row="1" VerticalAlignment="Top" >
                <dragdrop:DropTarget.DropBorderBrush>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                         <GradientStop Color="#FFD83F00" Offset="0"/>
                        <GradientStop Color="#FFF65E00" Offset="1"/>
                    </LinearGradientBrush>
                </dragdrop:DropTarget.DropBorderBrush>
                <dragdrop:DropTarget.Content>
                    <dragdrop:DragSource DraggingEnabled="False">
                        
                        <Image Source="Images/box_open.png" HorizontalAlignment="Center"
                               VerticalAlignment="Center" Width="128" Height="128">
                            </Image>

                    </dragdrop:DragSource>
                </dragdrop:DropTarget.Content>
            </dragdrop:DropTarget>
            
          
        
        </Grid>
        
        <ScrollViewer Grid.Row="3" Grid.ColumnSpan="2" Margin="10"
                                HorizontalAlignment="Center" 
 BorderThickness="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden"
                      HorizontalContentAlignment="Center"
                       VerticalAlignment="Top">
            
          <TextBlock x:Name="lblContent" 
                        ></TextBlock>
        </ScrollViewer>
        
    </Grid>
</UserControl>
